package com.linkhub.oms.admin.modules.order.service;

import com.linkhub.oms.admin.modules.order.domain.vo.orderpdf.OrderPdfVO;
import com.linkhub.oms.entity.OrderEntity;
import com.linkhub.oms.entity.OrderProductEntity;
import com.linkhub.oms.entity.resulttype.order.OrderInfoDO;

import java.util.List;
import java.util.Map;

/**
 * @Description: 订单信息组装服务
 * @Author: echo
 * @Date: 2024/3/31 22:26
 * @Version: 1.0
 */
public interface OrderInfoAssembleService {

    /**
     * 根据订单主表数据组装其他子表信息
     *
     * @param orders orders
     * @return orderInfoDO
     */
    List<OrderInfoDO> assembleOrderInfos(List<OrderEntity> orders);

    /**
     * 根据订单主表数据组装其他子表信息
     *
     * @param orders orders
     * @param deep   是否进行 entityMapping
     * @return orderInfoDO
     */
    List<OrderInfoDO> assembleOrderInfos(List<OrderEntity> orders, boolean deep);


    /**
     * 根据 {@code sysOrderIds} 组装订单主、子表信息
     *
     * @param sysOrderIds sysOrderIds
     * @return orderInfoDO
     */
    List<OrderInfoDO> assembleOrdersByIds(List<String> sysOrderIds);

    /**
     * 组装订单主、子表信息
     *
     * @param sysOrderIds sysOrderIds
     * @return orderInfoDO
     */
    OrderInfoDO assembleOrder(String sysOrderIds);

    /**
     * 组装拆分订单的子订单
     *
     * @param orderIds orderIds
     * @return subOrders
     */
    List<OrderInfoDO> assembleSubOrders(List<String> orderIds);


    /**
     * 查询订单所有本地商品ids
     *
     * @param orderIds orderIds
     * @return orderIds -> OrderProductEntity
     */
    Map<String, List<OrderProductEntity>> queryOrderLocalSkuIds(List<String> orderIds);

    /**
     * 组装订单PDF信息
     * @param orderInfoDO
     * @return
     */
    OrderPdfVO assembleOrderPdfInfo(OrderInfoDO orderInfoDO);

    /**
     * 批量组装订单PDF信息
     * @param sysOrderId
     * @return
     */
    List<OrderPdfVO> assembleOrderPdfInfos(List<String> sysOrderId);
}
